package com.apimarket.enums;

/**
 * NetContext异常枚举
 *
 * @author yyc
 */
public enum NetContextEnum {
    INSERT_ERROR(400, "插入异常"),
    UPDATE_ERROR(400, "更新异常"),
    DELETE_ERROR(400, "删除异常"),
    ID_ERROR(400, "id为空"),
    ROUTE_UNIQUE_ERROR(400,"路由名重复"),
    PLUGIN_PARAM_ERROR(400,"插件传参异常"),
    PLUGIN_UNIQUE_ERROR(400,"插件重复异常"),
    GROUP_UNIQUE_ERROR(400,"用户组名重复异常"),
    CONSUMER_UNIQUE_ERROR(400,"用户名重复异常");

    private int code;

    private String message;

    NetContextEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("NetContextEum{");
        sb.append("code=").append(code);
        sb.append(", message='").append(message).append('\'');
        sb.append('}');
        return sb.toString();
    }
}
